package cn.edu.scau.cmi.duzefeng.factory.abstractfactory.model;

import cn.edu.scau.cmi.duzefeng.factory.abstractfactory.insurance.CarDamageInsurance;
import cn.edu.scau.cmi.duzefeng.factory.abstractfactory.insurance.DriversDamageInsurance;
import cn.edu.scau.cmi.duzefeng.factory.abstractfactory.insurance.MultiDamageInsurance;
import cn.edu.scau.cmi.duzefeng.factory.abstractfactory.insurance.SomebodyDieSimpleInsurance;

public abstract class AbstractFactory {
	public abstract CarDamageInsurance getCarDamageInsurance();
	public abstract DriversDamageInsurance getDriversDamageInsurance();
	public abstract MultiDamageInsurance getMultiDamageInsurance();
	public abstract SomebodyDieSimpleInsurance getSomebodyDieSimpleInsurance();
	
	public enum FactoryType{
		PICC_Factory,PinAn_Factory
	}
	public static AbstractFactory getFactory(FactoryType type) {
		AbstractFactory factory = null;
		switch (type) {
		case PICC_Factory:
			factory = new PICCFactory();
			break;
		case PinAn_Factory:
			factory = new PinAnFactory();
			break;
		default:
			break;
		}
		return factory;
	}
}
